!!!###!!!title=165-How to configure the default selection effect of the legend component——VisActor/VChart FAQ documents!!!###!!!

How to configure the default selection effect of the legend component?

Question Description

In VChart, when there are a large number of legends, can a fixed number of legends be selected by default? Other legends are grayed out

Solution

VChart's legend component provides the configuration of default selection items, where you can configure the items you want to be selected by default, and other items will be automatically grayed out.

legends: [
  {
    type: 'discrete',
    defaultSelected: ['5 to 13 Years', '14 to 17 Years', '18 to 24 Years', '25 to 44 Years']
  }
];

Code Example

Quote